/**
 * 1
 *  
 * @Author : Ruoyu Wang
 * @DateTime : 24-10-18 下午6:48
 */

#include <iostream>

using namespace std;

int main() {
    int n, x, y;
    string s;
    cin >> n >> x >> y >> s;
    int a = 0, b = 0, c = 0;
    for (int i = 0; i < n; i++) {
        if (s[i] == 'A') {
            a++;
        } else if (s[i] == 'B') {
            b++;
        } else if (s[i] == 'C') {
            c++;
        }
    }
    if (x > y) {
        swap(x, y);
        swap(a, c);
    }
    long long res = 0;
    long long cnt = min(b, c);
    res = res + cnt * y;
    b -= cnt;
    cnt = min(a, b);
    res = res + cnt * x;
    cout << res;
    return 0;
}